//
//  YXInventoryViewController.m
//  跑跑快销
//
//  Created by 杨潇 on 14-5-5.
//  Copyright (c) 2014年 ylife. All rights reserved.
//

#import "YXInventoryViewController.h"

@interface YXInventoryViewController ()

@end

@implementation YXInventoryViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    _inventoryVi = [[YXInventoryView alloc] init];
    self.view = _inventoryVi;
    
    [_inventoryVi.segment addTarget:self action:@selector(touchSegmentController:) forControlEvents:UIControlEventValueChanged];
}

#pragma mark - ButtonsClick
- (void)touchSegmentController:(UISegmentedControl *)seg
{
    switch (seg.selectedSegmentIndex) {
        case 0:
        {
            _inventoryVi.searchTf.hidden = YES;
            _inventoryVi.updateBtn.hidden = YES;
            for (int i = 0; i < 2; i ++) {
                UILabel * typeLab = (UILabel *)[_inventoryVi viewWithTag:i + 10];
                CGRect rect = typeLab.frame;
                typeLab.frame = CGRectMake(rect.origin.x, 70, rect.size.width, rect.size.height);
            }
        }
            break;
        case 1:
        {
            _inventoryVi.searchTf.hidden = NO;
            _inventoryVi.updateBtn.hidden = NO;
            for (int i = 0; i < 2; i ++) {
                UILabel * typeLab = (UILabel *)[_inventoryVi viewWithTag:i + 10];
                CGRect rect = typeLab.frame;
                typeLab.frame = CGRectMake(rect.origin.x, 115, rect.size.width, rect.size.height);
            }
        }
            break;
            
        default:
            break;
    }
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
